<template>
  <div class="payment-notice">
    <!-- 标题和功能说明 -->
    <div style="margin-bottom: 15px;">
      <h3>缴费通知</h3>
    </div>

    <!-- 操作栏：按钮 + 搜索 -->
    <div class="operation-bar">
      <el-button type="primary">打印收费通知单</el-button>
      <el-button type="success" style="margin-left: 10px;">发短信</el-button>
      <el-button type="success" style="margin-left: 10px;">发微信</el-button>
      <div class="search-group" style="margin-left: auto;">
        <el-input placeholder="小区/房号/收费项目/收费标准" style="width: 240px;" />
        <el-button type="primary" icon="el-icon-search"></el-button>
        <el-button type="primary" icon="el-icon-filter"></el-button>
      </div>
    </div>

    <!-- 缴费通知表格 -->
    <el-table :data="tableData" border style="width: 100%; margin-bottom: 20px;">
      <el-table-column type="selection" width="55" />
      <el-table-column prop="community" label="小区" />
      <el-table-column prop="roomNo" label="房号" />
      <el-table-column prop="ownerName" label="住户姓名" />
      <el-table-column prop="receivable" label="应收金额" />
      <el-table-column prop="smsNotice" label="短信通知" />
      <el-table-column prop="wechatNotice" label="微信通知" />
      <el-table-column label="操作" width="280">
        <template slot-scope="scope">
          <el-button type="text" size="small">打印收费通知单</el-button>
          <el-button type="success" size="small" plain>发短信</el-button>
          <el-button type="success" size="small" plain>发微信</el-button>
        </template>
      </el-table-column>
    </el-table>

    <!-- 分页 -->
    <div class="pagination-wrap">
      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
        :page-sizes="[10, 20, 30, 40]" :page-size="10" layout="prev, pager, next, ->, jumper, ->, sizes, total"
        :total="90" />
    </div>
  </div>
</template>

<script>
export default {
  name: 'PaymentNotice',
  data() {
    return {
      currentPage: 1,
      tableData: [
        {
          community: '中山国际',
          roomNo: '1278809',
          ownerName: '张飒',
          receivable: 1.5,
          smsNotice: '6月',
          wechatNotice: '已发送'
        },
        {
          community: '中山国际',
          roomNo: '1278810',
          ownerName: '李华',
          receivable: 2.3,
          smsNotice: '未发送',
          wechatNotice: '6月'
        },
        {
          community: '中山国际',
          roomNo: '1278811',
          ownerName: '王芳',
          receivable: 1.8,
          smsNotice: '6月',
          wechatNotice: '未发送'
        },
        {
          community: '中山国际',
          roomNo: '1278812',
          ownerName: '赵伟',
          receivable: 3.2,
          smsNotice: '未发送',
          wechatNotice: '6月'
        },
        {
          community: '中山国际',
          roomNo: '1278813',
          ownerName: '刘强',
          receivable: 2.5,
          smsNotice: '6月',
          wechatNotice: '已发送'
        },
        {
          community: '中山国际',
          roomNo: '1278814',
          ownerName: '陈静',
          receivable: 1.9,
          smsNotice: '未发送',
          wechatNotice: '6月'
        }
      ]
    }
  },
  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.currentPage = val;
    }
  }
}
</script>

<style scoped>
.payment-notice {
  padding: 20px;
}

.desc {
  font-size: 14px;
  color: #606266;
  margin-bottom: 15px;
}

.operation-bar {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.search-group {
  display: flex;
  align-items: center;
}

.search-group .el-input {
  margin-right: 8px;
}

.pagination-wrap {
  display: flex;
  justify-content: flex-end;
}
</style>